<?php
/**
 * Created by PhpStorm.
 * User: v.xiaqc
 * Date: 2019/2/13
 * Time: 16:55
 */
$redis = new Redis();

$redis->connect('192.168.56.105', 6379);
$redis->auth('123456');
$data = [
    'name' => 'job',
    'sex'  => '男',
    'age'  => '30',
    'address' => 'Henan'
];
$redis->set('student', json_encode($data));
$student = $redis->get('student');

print_r(json_decode($student, true));